﻿using System.ComponentModel;
using VNet.VisiSuite.Common.Resource;

namespace VNet.VisiSuite.VisiBoard.Models
{
    public class BaseModel : INotifyPropertyChanged
    {
        #region Implement INotifiedPropertyChanged

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        #endregion

        #region Properties

        public bool ShouldValidate { get; set; }

        private string _errorMessage;
        public string ErrorMessage
        {
            get { return _errorMessage; }
            set
            {
                _errorMessage = value;
                OnPropertyChanged("ErrorMessage");
            }
        }

        private bool _isAddNew;
        public bool IsAddNew
        {
            get { return _isAddNew; }
            set
            {
                _isAddNew = value;
                OnPropertyChanged("IsAddNew");
            }
        }

        #endregion
    }
}
